package com.webblog.service.blogMapTags;

import com.webblog.dao.blogMapTags.BlogMapTagsMapper;
import com.webblog.pojo.BlogMapTags;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BlogMapTagServiceImpl implements BlogMapTagService {

    @Autowired
    private BlogMapTagsMapper blogMapTagsMapper;

    public Integer addTagList(List<BlogMapTags> tagsList) {
        return blogMapTagsMapper.insertMapper(tagsList);
    }

    public Integer updateTagList(List<BlogMapTags> tagsList,int blogId) {
        blogMapTagsMapper.deleteMapper(blogId);
        return this.addTagList(tagsList);
    }

    public Integer removeTagList(int blogId) {
        return blogMapTagsMapper.deleteMapper(blogId);
    }
}
